package com.varian.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.varian.tool.Func;
import com.varian.tool.enums.BaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author ben
 * @since 2025/2/8
 */
@Getter
@RequiredArgsConstructor
public enum ParamTypeEnum implements BaseEnum<ParamTypeEnum> {

    BOOLEAN(0),
    NUMBER(1),
    STRING(2),
    DATETIME(4),
    ;

    @EnumValue
    @JsonValue
    final Integer value;

    @Override
    public ParamTypeEnum convert(Integer value) {
        return Func.findBaseEnumByValue(values(), value);
    }
}
